get all indices of a value in list python

38

indices = [i for i, x in enumerate(my_list) if x == "whatever"]

Comments

Submit
0 Comments